/*-----------------------------------------------File Info------------------------------------------------
** File Name:               SerialFalshSubarea.c  
** Last modified date:      20170316
** Last version:            V0.1
** Description:             
**--------------------------------------------------------------------------------------------------------            
** Created date:            2016.09.07
** author:                  YLY
** Version:                 V0.1
** Descriptions:            FLASH分区 
**--------------------------------------------------------------------------------------------------------
*/
/*************************************************************
* 	include 
* 	头文件	
*************************************************************/
#include "SerialFlashSubarea.h"
#include "SerialFlash.h"

tsSerialFlash tgFlash;
const uint32_t uiBuf040[] = VF040_SUBAREA_QUEUE;
const uint32_t uiBuf080[] = VF080_SUBAREA_QUEUE;
const uint32_t uiBuf016[] = VF016_SUBAREA_QUEUE;


/*		vSerialFlashSubareaInit
 *  说明: FLSH分区初始化
 *	参数:	
 *	返回: 	
 */
void vSerialFlashSubareaInit(void)
{
	switch(ucgSerialFlashType)
	{
		case FLASH_CHIP_SST25VF040_ID:
		case FLASH_CHIP_W25Q40_ID:	
		{
			memcpy(&tgFlash,(tsSerialFlash *)uiBuf040,sizeof(tsSerialFlash));		
			FLASH_PRINTF("040 uiSubareaByteSize %d\n",tgFlash.uiSubareaByteSize);			
		}break;

		case FLASH_CHIP_SST25VF080_ID:
		case FLASH_CHIP_W25Q80_ID:	
		{
			memcpy(&tgFlash,(tsSerialFlash *)uiBuf080,sizeof(tsSerialFlash));		
			FLASH_PRINTF("080 uiSubareaByteSize %d\n",tgFlash.uiSubareaByteSize);			
		}break;	

		case FLASH_CHIP_SST25VF016_ID:
		case FLASH_CHIP_W25Q16_ID:	
		{
			
			memcpy(&tgFlash,(tsSerialFlash *)uiBuf016,sizeof(tsSerialFlash));		
			FLASH_PRINTF("016 uiSubareaByteSize %d\n",tgFlash.uiSubareaByteSize);			
		}break;			
	}
}	














